Namespace - LJCDBClientLib
Parameters
dataObject - The record object.
propertyNames - The included column property names.
includeNull - Includes columns with null value.
Returns
The result object.
Syntax
C# |
public DbResult Add(Object dataObject, List<String> propertyNames = null, Boolean includeNull = False)
|
Adds a record to the database.
(RE)
Remarks
Parameters
propertyNames
This parameter defines the primary table column values that are to be
added. If it is null, then all the primary table column values are
added.
It must not include Calculated or Join columns or it will cause an error.
Creates an "Insert"
DbRequest
object. The
DbRequest.Columns
object includes the definitions for the columns to be updated in the base
table.
The DbRequest.Columns include all columns from the BaseDefinition by default;
except it does not include AutoIncrement columns or columns with null
values. To include a null column value, set the column value to "-null". It
only includes the columns contained in the optional propertyNames parameter
if provided. It uses the columns in the ChangedNames object if it exists and
the propertyNames parameter is null.
The DbRequest.Columns do not include AutoIncrement columns or columns with
null values. To include a null column value, set the column value to
"-null".
The Key Columns are assigned from the LookupColumnNames property. The
keyColumn.ColumnName must be available in the BaseDefinition object to
be included.
The Key Columns are those columns whose value will be used to find the
added record. This is to return the DB Assigned column values to the
calling program.
The keyColumns do not use keys with null values or invalid dates. To include
a null column value, set the column value to "'-null'".
Verify: The Key Columns must include the DB Assigned columns for the assigned
values to be returned to the calling program. The value must be set to
zero to prevent including it as a key value?
Verify: The Lookup Retrieve call will not include keys with a value of "0".
Verify: The Add Data Object property names must be the same as the Request Column
property names to map the values into the Key Columns.
Method Graph
All methods are in LJCDBMessage.DbCommon.
RequestDataColumns(dataObject)
RequestColumns(baseDefinition)
DataColumns(dataObject)
CreateValueColumn(dbColumn)
RequestLookupKeys(dataObject)
RequestColumns(baseDefinition)
LookupKeys(dataObject)
IsKeyColumn(dbColumn)
Example
C# |
using LJCNetCommon;
using LJCDBMessage;
<span class='xmlComment'>/// <summary>
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.